os system python

15

# importing os module 
import os 
  
# Command to execute
# Using Windows OS command
cmd = 'date'
  
# Using os.system() method
os.system(cmd)
>>> import os
>>> os.name
'posix'
>>> import platform
>>> platform.system()
'Linux'
>>> platform.release()
'2.6.22-15-generic'

Comments

Submit
0 Comments